package com.example.weather;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.lang.invoke.MutableCallSite;
import java.util.ArrayList;
import java.util.List;

public class MainVM extends ViewModel {
    private MutableLiveData<List<String>> citylist;

    public MutableLiveData<List<String>> getCitylist() {
        if(citylist==null){
            citylist=new MutableLiveData<>();
            List<String>lst=new ArrayList<>();
            lst.add("北京");
            citylist.setValue(lst);
        }
        return citylist;
    }
    public void add(int x){

    }
    public void setCitylist(List<String> citylist) {
        getCitylist().setValue(citylist);
    }
}
